<html>
<head>
<title>Clear Data Stores</title>
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js">
</script>
<script>
function clearmodel(what) {
	ajx = new Ajax.Request("/admin/datastore",{parameters:"model="+what+"&action=cp",asynchronus:false,onComplete:complete})
}
function complete() {
	alert("Completed Clearing")
	location.reload(true);
}

</script>
</head>
<body>
<table border="1">
<tr><th>Model Class</th><th>No of Objects</th><th>Clear?</th></tr>
{% for cname in models_list.items %}
<tr> <td>{{ cname.0 }}</td><td>{{ cname.1 }}</td><td><input type="button" value="Clear" onclick="confirm('Clear {{cname.0}}') && clearmodel('{{cname.0}}')"></td></tr>
{% endfor %}

</table>
</body>
</html>
